-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update FFmpeg to 7.0.1 #406
Conversation
The nvidia test suite was never run after livepeer#393 so this breakage was not noticed.
* Set the encoder timebase using AVCodecContext.framerate instead of the decoder's AVCodecContext.time_base. The use of AVCodecContext.time_base is deprecated for decoding. See https://ffmpeg.org/doxygen/3.3/structAVCodecContext.html#ab7bfeb9fa5840aac090e2b0bd0ef7589 * Adjust the packet timebase as necessary for FPS pass through to match the encoder's expected timebase. For filtergraphs using FPS adjustment, the filtergraph output timebase will match the framerate (1 / framerate) and the encoder is configured for the same. However, for FPS pass through, the filtergraph's output timebase will match the input timebase (since there is no FPS adjustment) while the encoder uses the timebase detected from the decoder's framerate. Since the input timebase does not typically match the FPS (eg 90khz for mpegts vs 30fps), we need to adjust the packet timestamps (in container timebase) to the encoder's expected timebase. * For the specific case of FPS passthrough, preserve the original PTS as much as possible since we are trying to re-encode existing frames one-to-one. Use the opaque field for this, since it is already being populated with the original PTS to detect sentinel packets during flushing. Without this, timestamps can be slightly "squashed" down when rescaling output packets to the muxer's timebase, due to the loss of precision (eg, demuxer 90khz -> encoder 30hz -> muxer 90khz)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #406 +/- ##
===================================================
+ Coverage 49.88901% 50.20216% +0.31315%
===================================================
Files 12 12
Lines 1802 1484 -318
===================================================
- Hits 899 745 -154
+ Misses 852 689 -163
+ Partials 51 50 -1 see 12 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Updates to the latest ffmpeg release (7.0.1) and adjust unit tests to match some slightly changed behaviors in the CLI that is used for testing. This also uncovered a bug that was fixed as described in #405 but is also included in this PR (see commit message).
The unit tests all pass with zero timestamp adjustments, so this update should be reasonably backwards-compatible with older LPMS. In fact, the updated LPMS transcoder still passes the full test suite even when the test suite is running the old ffmpeg CLI. The unit test changes are only there to make the tests pass when running with the new CLI, mostly changes in a few ffprobe fields and command-line options.
Commits
Pre-Merge
n7.0.1-livepeer
branch, updateinstall_ffmpeg.sh
in this PR if necessary - fixup with fbbd746Post-Merge
install_ffmpeg.sh
to point to the LPMS script